<%@page import="Model.Approval"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Database.StaffAppointmentDB"%>
<%@page import="Logic.CalendarMethods"%>
<%@page import="java.util.Calendar"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">

	body {
		font-family: arial;
	}
	td {
		border-top: 1px solid black;
		border-left: 1px solid black;
	}
	.lastCol {
		border-right: 1px solid black;
	}
	.noprint
	{
		display: block;
	}
	@media print{.noprint { display: none;}}

</style>
</head>

<body>
<% if (request.getParameter("table") != null && request.getParameter("id")!=null && request.getParameter("table") != "" && request.getParameter("id") != ""){ %>
<% String table = request.getParameter("table").toString();
String id = request.getParameter("id").toString();
System.out.println(id);
try
{
ArrayList<Approval> app = new ArrayList<Approval>();
app = StaffAppointmentDB.getStaffOfAppointment(id);	%>
	<span class="noprint"><a href="javascript:window.print()">Click
			to Print This Page</a></span>
	<strong>APPOINTMENT</strong>
	<hr style="height: 1px; background-color: black; margin-bottom: 25px;" />
	<span style="text-decoration: underline; font-weight: bold;"><%=app.get(0).getAppointment() %></span>
	<br />
	<br />
	<%if (table.equals("yes")){ %>
	<div
		style="border-right: 1px solid black; border-bottom: 1px solid black">
		<table style="width: 100%;" cellspacing=0 cellpadding=5>
			<%
			for(int i = 0; i < app.size(); i++)
			{
				out.print("<tr>");
				out.print("<td>" + app.get(i).getDescription() + "</td>");
				out.print("<td>" + app.get(i).getName() + "</td>");
				out.print("</tr>");
			}
			%>
		</table>
	</div>
	<%} else { 
		for(int i = 0; i < app.size(); i++)
		{
			out.print(app.get(i).getName() + "<br/>");
		}
	}%>
	<br />
	<br />
	<span style="text-decoration: underline; font-weight: bold;">Roles
		&amp; Responsibilities</span>

	<br /><br/>
	
	<%out.print(app.get(0).getResponsibility()); %>
	
	<br /> Approved by: Director, School of Information Technology
	<br />
	<br />Effective Date:
	<%
		out.print(CalendarMethods.formatDateToString(Calendar.getInstance()));
	%>
	<br />
	<br />This is a computer generated copy no signature is needed.
	<%}catch(Exception e){out.print("No data to print");} %>
	<%} %>
</body>
</html>